<?php
declare(strict_types = 1);
namespace vinchan\encryption\Code;

use vinchan\encryption\Kernel\CodeInterface;

class HexBin implements CodeInterface
{
	/**
	 * [hexbin解码数据]
	 * @param  string $data [description]
	 * @return [type]       [description]
	 */
	public function decode(string $data):string
	{
		return hex2bin($data);
	}

	/**
	 * [hexbin加码数据]
	 * @param  string $data [description]
	 * @return [type]       [description]
	 */
	public function encode(string $data):string
	{
		return strtoupper(bin2hex($data));
	}
}